<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h2>编辑员工</h2>
    <form action="{{route('staffs.update', $staff->staff_id)}}" method="post">
        @method('put')
        @csrf
        <p>
            <label for="name">姓名:</label>
            <input type="text" name="name" id="name" value="{{$staff->name}}">
        </p>

        <p>
            <label for="male">性别:</label>
            <input type="radio" name="sex" id="male" value="1" @if($staff->sex === 1) checked @endif><label for="male">男</label>
            <input type="radio" name="sex" id="female" value="0" @if($staff->sex === 0) checked @endif><label for="female">女</label>
        </p>

        <p>
            <label for="age">年龄:</label>
            <input type="number" name="age" id="age" min="18" max="60" value="{{$staff->age}}">
        </p>

        <p>
            <label for="salary">工资:</label>
            <input type="number" name="salary" id="salary" value="{{$staff->salary}}">
        </p>

        <p>
            <label for="email">邮箱:</label>
            <input type="email" name="email" id="email" value="{{$staff->email}}">
        </p>

        <p>
            <label for="mobile">手机:</label>
            <input type="tel" name="mobile" id="mobile" value="{{$staff->mobile}}">
        </p>

        <p>
            <label for="password">密码:</label>
            <input type="password" name="password" id="password" value="{{$staff->password}}">
        </p>

        <p>
            <button>保存</button> <a href="{{route('staffs.index')}}">返回</a>
        </p>
    </form>
</body>

</html>